
public class CompteurTestReader {


	//private SharedObject cpt;
	static String myName;
	

	public static void main (String argv[]) {
		if (argv.length != 1) {
			System.out.println("java CompteurTest <name>");
			return;
		}
		myName = argv[0];

		 //initialize the system
		Client.init();
		//SharedObject c = null;
		// look up the IRC object in the name server
		// if not found, create it, and register it in the name server
		
		SharedObject c = Client.lookup("CompteurTest");
		Compteur cpt= null;
		if (c == null) {
			cpt = new Compteur();
			c = Client.create(cpt);
			System.out.println(c.id);
			Client.register("CompteurTestReader", c);
		}else{
		
		//for (int i = 1; i<10000; i++){
			 cpt = (Compteur)c.obj;
			 System.out.println("on est là "+ cpt.getCpt());
			
		}
		c.lock_read();
		cpt.read();
		c.unlock();
		//}

	}
}